<div class="container">
    <h4>Quản trị database hệ thống</h4>
</div>
<div class="container" style="margin-bottom: -1px;" >
    <div style="margin-top: 10px" >
        <ul class="nav nav-tabs nav-collapse">
            <li class="active">
                <a href="">Danh sách bảng</a>
            </li>
        </ul>
    </div>      
</div>    
<div class="container" style="border: 1px solid #ccc;" >
    <p class="clearfix" ></p>
    <table  class="table table-striped table-bordered table-responsive">
        <thead>
            <tr class="success" >
                <th class="text-center">STT</th>
                <th class="text-center">Bảng</th>
                <th class="text-center">Class</th>                             
                <th class="text-center">Đường dẫn</th>                             
                <th class="text-center">
                    <button type="button" onclick="database.createdatabase()" class="btn btn-success" >
                        <i class="glyphicon glyphicon-plus"></i> 
                        Tạo database  [<?= $databsae ?>]
                    </button>
                </th>
            </tr>
        </thead>
        <tbody>
            <?php
            $i = 1;
            foreach ($tables as $table) {
                ?>
                <tr class="<?= $table->create ? 'success' : '' ?>" >
                    <td class="text-center"><?= $i ?></td>
                    <td class="text-center"><?= $table->table ?></td>
                    <td class="text-center"><?= $table->class ?></td>
                    <td class="text-center"><?= $table->path ?></td>
                    <td class="text-center">
                        <div class="btn-group">
                            <button type="button" class="btn btn-info" onclick="database.get('<?= $table->class ?>');" >
                                <i class="glyphicon glyphicon-tag"></i> Chi tiết
                            </button>
                            <?php if (!$table->create) { ?>
                                <button type="button" class="btn btn-success" onclick="database.create('<?= $table->class ?>');" >
                                    <i class="glyphicon glyphicon-plus"></i> Tạo bảng
                                </button>
                            <?php } else { ?>
                                <button type="button" class="btn btn-warning" onclick="database.clear('<?= $table->table ?>');" >
                                    <i class="glyphicon glyphicon-remove-circle"></i> clear data
                                </button>
                                <button type="button" class="btn btn-danger" onclick="database.remove('<?= $table->table ?>');" >
                                    <i class="glyphicon glyphicon-remove"></i> Xóa bảng
                                </button>
                            <?php } ?>
                        </div>
                    </td>
                </tr>
                <?php
                $i ++;
            }
            ?>
        </tbody>
    </table>
</div>     
